package com.ltmall.api.dao;

import com.ltmall.api.bean.*;
import com.ltmall.api.util.PageUtil;

import java.util.List;

public interface IAccountDAO {
	//判断手机号是否已经注册
	public boolean isPhoneUsed(String phone);
	//添加配置文件
	public void addClientConfig(ClientConfig config);
	//添加个人信息
	public void addClientInfo(ClientInfo info);
	//手机号登陆
	public boolean phoneLogin(String phone, String pass);
	//修改token
	public boolean updateToken(int userID, String token);
	//获取个人配置
	public ClientConfig getConfig(int userID);
	//获取个人账户
	public ClientAccount getAccount(String phone, int userID);
	//获取个人信息
	public ClientInfo getInfo(int userID);
	//修改个人信息
	public boolean updateInfo(int userID, String name, int sex);
	//更新等级
	public boolean updateLevel(int userId, int levelId);
	//验证
	public boolean validate(int userID, String userToken);
	//修改个人头像
	public boolean updatePhoto(int userID, String photo);
	//添加收获地址
	public boolean addDelevery(DeliveryAddr addr);
	//修改收获地址
	public boolean updateDelevery(int addrID, int userID, String name, String phone, String address, String province, String city, String county, int isDefault);
	//修改所有其他地址为不缺省
	public void updateOtherDelevery(int userID, int addrID, int isDefault);
	//删除收获地址
	public boolean deleDelivery(int addrID);
	//获取收货地址
	public List<DeliveryAddr> getDelivery(int userID, int number);
	//修改密码
	public boolean updatePass(int userID, String pass);
	//商家注册
	public boolean addBussinessInfo(BussinessInfo bInfo);
	//添加商家配置和帐号
	public void addBussinessAccount(BussinessAccount bAccount);
	//获取用户收获地址
	public DeliveryAddr getAddr(int addrID);
	
	//添加收藏
	public boolean addCollection(Collection collection);
	//判断收藏是否存在
	public boolean isCollectionExist(Collection collection);
	//收藏列表
	public List<?> collectionList(int userID, PageUtil page);
	//取消收藏
	public boolean cancelCollection(int collectionID, int userID);
	
	//修改籍贯
	public boolean  editHome(int userID, String province, String city, String county);
	//添加反馈
	public boolean addFeedback(Feedback feedback);
	//检测用户是否存在
	public ThClientPlatforms checkUserExistByOpenID(String opendID);
	
	public void addClientPlatform(ThClientPlatforms platform);
	// 获取平台账户
	public ThClientPlatforms getClientPlatformByUserId(int userId);
	// 获取平台账户
	public ThClientPlatforms getClientPlatformByOpenId(String openId);
		
	//获取等级信息
	public ThUserLevels userLevelGet(int levelId);
	
	public boolean saveClientAccount(ClientAccount clientAccount);
	
	//更新用户默认直供小区编号
	public boolean editDirectSupplyId(int userID, String directSupplyId);
}
